package com.lry.pda.bottom.operation;

import com.lry.pda.topdown.SymbolDefine;

import java.util.ArrayList;
import java.util.List;

public class Symbols {

    //表达式左边
    public int value;

    public boolean isNullable;

    //表达式右边，因为表达式右边可能有多个或者关系，所以是list
    public List<List<Integer>> productions = new ArrayList<>();

    //first集合，首符集
    public List<Integer> firstSet = new ArrayList<>();

    public Symbols(int value, boolean isNullable){
        this.value = value;
        this.isNullable = isNullable;
        if(value< SymbolDefine.STMT){
            //终结符的首符集是自己
            this.firstSet.add(value);
        }
    }

    public void addProduction(List<Integer> rights){
        this.productions.add(rights);
    }

}
